﻿using System;

namespace NiuX.Objects;

public static class ComparisonExtensions
{
    /// <summary>
    /// 取最大值
    /// </summary>
    /// <param name="time1"></param>
    /// <param name="time2"></param>
    /// <returns></returns>
    public static DateTime GetMaxValue(this DateTime time1, DateTime time2) => time1 > time2 ? time1 : time2;
    
    /// <summary>
    /// 取最小值
    /// </summary>
    /// <param name="time1"></param>
    /// <param name="time2"></param>
    /// <returns></returns>
    public static DateTime GetMinValue(this DateTime time1, DateTime time2) => time1 < time2 ? time1 : time2;
}